package o;

import android.app.Activity;
import android.content.Context;
import android.os.CountDownTimer;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewStub;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.DrawableRes;
import com.huawei.appmarket.support.video.VideoPlayer;
import com.huawei.hwid.core.constants.HwAccountConstants;
import java.util.Formatter;
import java.util.LinkedHashMap;
import java.util.Locale;
import o.dky.a;
import o.dky.h;
import o.dky.i;
import o.dky.j;
import VideoNetChangeDialog.d;

public class evo extends evq implements OnClickListener, OnSeekBarChangeListener {
    private TextView ʻ;
    private RelativeLayout ʻॱ;
    private RelativeLayout ʼ;
    private CountDownTimer ʼॱ;
    private ImageView ʽ;
    private boolean ʽॱ;
    private long ʾ;
    private boolean ʿ;
    private CountDownTimer ˈ;
    private int ˉ;
    private final Formatter ˊ;
    private View ˊˊ;
    private String ˊˋ;
    private ImageView ˊॱ;
    private String ˊᐝ;
    private final StringBuilder ˋ;
    private ViewStub ˋˊ;
    private boolean ˋˋ;
    private SeekBar ˋॱ;
    private long ˋᐝ;
    private long ˌ;
    private String ˍ;
    private evn ˎ;
    private boolean ˎˎ;
    private Context ˏ;
    private ImageView ˏॱ;
    private ImageView ͺ;
    private e ॱ;
    private TextView ॱˊ;
    private ImageView ॱˋ;
    private RelativeLayout ॱˎ;
    private ImageView ॱॱ;
    private ImageView ॱᐝ;
    private ImageView ᐝ;
    private LinearLayout ᐝॱ;

    public interface e {
        void ˋ(int i);
    }

    public evo(Context context) {
        this(context, i.ͺॱ);
    }

    public evo(Context context, boolean z) {
        this(context, i.ͺॱ, z);
    }

    public evo(Context context, int i) {
        this(context, i, false);
    }

    public evo(Context context, int i, boolean z) {
        super(context);
        this.ʿ = false;
        this.ʾ = 0;
        this.ˉ = ccz.ॱ();
        this.ˊᐝ = "0";
        this.ˊˋ = "0";
        this.ˋˋ = false;
        this.ˏ = context;
        ॱ(i);
        this.ˋ = new StringBuilder();
        this.ˊ = new Formatter(this.ˋ, Locale.getDefault());
        this.ˎˎ = z;
    }

    public void setPosterVisibleListener(e eVar) {
        this.ॱ = eVar;
    }

    private void ॱ(int i) {
        LayoutInflater.from(this.ˏ).inflate(i, this, true);
        this.ॱॱ = (ImageView) findViewById(h.ˋॱ);
        this.ᐝ = (ImageView) findViewById(h.ᐝˊ);
        this.ॱॱ.setOnClickListener(this);
        setOnClickListener(this);
        this.ˉ = ʻ();
    }

    protected int ʻ() {
        if (this.ˎˎ || !(getContext() instanceof Activity)) {
            return 4;
        }
        return dgm.ˎ((Activity) getContext());
    }

    private void ˊॱ() {
        if (this.ˊˊ == null) {
            if (this.ˋˊ == null) {
                this.ˋˊ = (ViewStub) findViewById(h.ॱᐧ);
            }
            if (this.ˊˊ == null) {
                this.ˊˊ = this.ˋˊ.inflate();
            }
            this.ʼ = (RelativeLayout) this.ˊˊ.findViewById(h.ॱॱ);
            this.ʽ = (ImageView) this.ˊˊ.findViewById(h.ˏॱ);
            this.ʻॱ = (RelativeLayout) this.ˊˊ.findViewById(h.ꓸ);
            this.ॱˎ = (RelativeLayout) this.ˊˊ.findViewById(h.ˈॱ);
            this.ʻ = (TextView) this.ˊˊ.findViewById(h.ˋʻ);
            this.ॱˊ = (TextView) this.ˊˊ.findViewById(h.ʽॱ);
            this.ˋॱ = (SeekBar) this.ˊˊ.findViewById(h.ˏͺ);
            this.ˏॱ = (ImageView) this.ˊˊ.findViewById(h.ᶥ);
            this.ˊॱ = (ImageView) this.ˊˊ.findViewById(h.ꜞ);
            this.ͺ = (ImageView) this.ˊˊ.findViewById(h.ˌॱ);
            this.ॱˋ = (ImageView) this.ˊˊ.findViewById(h.ˊʽ);
            this.ॱᐝ = (ImageView) this.ˊˊ.findViewById(h.ꜟ);
            this.ᐝॱ = (LinearLayout) this.ˊˊ.findViewById(h.ﾞ);
            this.ʽ.setOnClickListener(this);
            this.ˏॱ.setOnClickListener(this);
            this.ͺ.setOnClickListener(this);
            this.ˊॱ.setOnClickListener(this);
            this.ॱˋ.setOnClickListener(this);
            this.ॱᐝ.setOnClickListener(this);
            this.ˋॱ.setOnSeekBarChangeListener(this);
            this.ᐝॱ.setClickable(true);
            this.ˏॱ.setContentDescription(getContext().getResources().getString(j.ˋˋ));
            this.ͺ.setContentDescription(getContext().getResources().getString(j.ˋˋ));
            this.ʽ.setContentDescription(getContext().getResources().getString(j.ˍ));
            this.ॱᐝ.setContentDescription(getContext().getResources().getString(j.ˍ));
            this.ॱॱ.setContentDescription(getContext().getResources().getString(j.ˍ));
            int paddingStart = this.ˋॱ.getPaddingStart();
            if (MinimumFactory.getBoolValue(this.ˋॱ.getContext())) {
                this.ॱˊ.setPadding(paddingStart, 0, 0, 0);
                this.ʻ.setPadding(0, 0, paddingStart, 0);
                return;
            }
            this.ʻ.setPadding(paddingStart, 0, 0, 0);
            this.ॱˊ.setPadding(0, 0, paddingStart, 0);
        }
    }

    public void ˏ() {
        ˊॱ();
    }

    public void setPlayOutTime(long j) {
        this.ˍ = String.valueOf(j);
    }

    public ImageView ॱ() {
        return this.ᐝ;
    }

    public ImageView ॱॱ() {
        return this.ॱॱ;
    }

    public void setImage(@DrawableRes int i) {
        this.ᐝ.setImageResource(i);
    }

    public void ˏ(evp o_evp) {
        if (o_evp != null) {
            ˋ(this.ॱॱ, o_evp.ˊ());
            ˋ(this.ᐝ, o_evp.ˋ());
            this.ˋˋ = o_evp.ˏॱ();
        }
    }

    public evn ˎ() {
        return this.ˎ;
    }

    public void setVideoPlayer(evn o_evn) {
        this.ˎ = o_evn;
    }

    private void ͺ() {
        if (ॱˎ()) {
            ॱᐝ();
        } else {
            ʻॱ();
        }
    }

    private void ॱᐝ() {
        this.ˊॱ.setImageResource(a.ॱᐝ);
        this.ॱˋ.setImageResource(a.ॱᐝ);
        this.ˊॱ.setContentDescription(getContext().getResources().getString(j.ˏˏ));
        this.ॱˋ.setContentDescription(getContext().getResources().getString(j.ˏˏ));
    }

    private void ʻॱ() {
        this.ˊॱ.setImageResource(a.ᐝॱ);
        this.ॱˋ.setImageResource(a.ᐝॱ);
        this.ˊॱ.setContentDescription(getContext().getResources().getString(j.ˑ));
        this.ॱˋ.setContentDescription(getContext().getResources().getString(j.ˑ));
    }

    private void ॱˋ() {
        ˊ(ॱˎ());
    }

    private boolean ॱˎ() {
        boolean z = true;
        int ˎ = evt.ˎ(this.ˎ.ॱ());
        if (ˎ == -1) {
            if (this.ˎ.ʼॱ()) {
                z = false;
            }
            if (evr.ˏ()) {
                return z;
            }
            return false;
        } else if (ˎ == 1) {
            return true;
        } else {
            return false;
        }
    }

    public boolean ʽ() {
        if (this.ˎ == null || this.ˋˋ) {
            return false;
        }
        if (VideoNetChangeDialog.ˊ() && VideoNetChangeDialog.ˏ(getContext()) && this.ˎ.ʻॱ()) {
            if (this.ˎˎ) {
                ʾ();
            } else {
                VideoNetChangeDialog o_evs = new VideoNetChangeDialog(getContext());
                o_evs.ˋ(new d(this) {
                    final /* synthetic */ evo ˋ;

                    {
                        this.ˋ = r1;
                    }

                    public void ˊ() {
                        if (this.ˋ.ˎ.ᐝॱ()) {
                            this.ˋ.ˎ.ʻ();
                        }
                    }

                    public void ॱ() {
                        if (this.ˋ.ˎ.ʼॱ()) {
                            this.ˋ.ˎ.ˊ();
                        }
                    }
                });
                o_evs.ˋ();
            }
        }
        return super.ʽ();
    }

    private void ᐝॱ() {
        if (this.ˎ instanceof VideoPlayer) {
            VideoPlayer.d ˏ = ((VideoPlayer) this.ˎ).ˏ();
            if (ˏ != null) {
                ˏ.ˏ(getContext());
                return;
            } else {
                Logger.ˋ("VideoPlayerController", "BuoyNetStateCallBack is null");
                return;
            }
        }
        Logger.ˋ("VideoPlayerController", "mVideoPlayer not instanceof VideoPlayer");
    }

    private void ʾ() {
        if (this.ˎ instanceof VideoPlayer) {
            VideoPlayer.d ˏ = ((VideoPlayer) this.ˎ).ˏ();
            if (ˏ != null) {
                ˏ.ˋ(getContext());
                return;
            } else {
                Logger.ˋ("VideoPlayerController", "BuoyNetStateCallBack is null");
                return;
            }
        }
        Logger.ˋ("VideoPlayerController", "mVideoPlayer not instanceof VideoPlayer");
    }

    public void ˎ(int i) {
        Logger.ˏ("VideoPlayerController", "onPlayStateChanged,playState: " + i);
        evr.ˊ().ˎ(this.ˎ.ॱ(), i);
        switch (i) {
            case -2:
                ˋˊ();
                this.ˋᐝ = System.currentTimeMillis();
                this.ˌ = this.ˎ.ˊᐝ();
                return;
            case -1:
                ˈ();
                return;
            case 1:
                etc.ˊ(this.ˎ.ˋˋ(), this.ˊᐝ);
                return;
            case 2:
                ʼॱ();
                return;
            case 3:
                ʿ();
                return;
            case 4:
                ˊˊ();
                return;
            case 5:
                ˊˊ();
                return;
            case 6:
                ʽॱ();
                return;
            case 7:
                ॱˊ();
                ˏ(false);
                ˊˋ();
                this.ॱॱ.setVisibility(0);
                if (this.ˎ.ʼॱ()) {
                    this.ˎ.ˊ();
                }
                this.ˎ.ˍ();
                evr.ˊ().ॱॱ();
                evr.ˊ().ʼ();
                return;
            default:
                return;
        }
    }

    private void ʼॱ() {
        this.ᐝॱ.setVisibility(0);
        if (!ˏˎ()) {
            this.ʼ.setVisibility(8);
        }
        this.ॱॱ.setVisibility(8);
        ॱˋ();
    }

    private void ʽॱ() {
        ॱˋ();
        this.ᐝॱ.setVisibility(0);
        this.ʽ.setImageResource(a.ॱˊ);
        this.ॱᐝ.setImageResource(a.ॱˊ);
        ˎˏ();
    }

    private void ʿ() {
        ॱˋ();
        ˏ(8);
        this.ᐝॱ.setVisibility(8);
        ˑ();
        this.ॱॱ.setVisibility(8);
        this.ʽ.setImageResource(a.ॱˊ);
        this.ॱᐝ.setImageResource(a.ॱˊ);
        ˎˏ();
    }

    private void ˈ() {
        this.ᐝॱ.setVisibility(8);
        ˊᐝ();
        ॱˊ();
        ˏ(false);
        this.ʽ.setImageResource(a.ʻॱ);
        this.ॱᐝ.setImageResource(a.ʻॱ);
        if (this.ˎ.ʽॱ()) {
            this.ˎ.ˍ();
            evr.ˊ().ॱॱ();
            evr.ˊ().ʼ();
        }
    }

    private void ˋˊ() {
        if (!ʼ()) {
            evt.ˊ(this.ˎ.ˋˋ(), this.ˉ);
        }
    }

    private void ˊˋ() {
        if (this.ˎ != null && this.ᐝ != null) {
            if (TextUtils.isEmpty(this.ˎ.ˋ())) {
                ˏ(8);
            } else {
                ˏ(0);
            }
        }
    }

    private void ˏ(int i) {
        if (this.ᐝ != null) {
            this.ᐝ.setVisibility(i);
        }
        if (this.ॱ != null) {
            this.ॱ.ˋ(i);
        }
    }

    private void ˊˊ() {
        this.ᐝॱ.setVisibility(8);
        if (this.ˎ.ʼॱ()) {
            ͺॱ();
            ˏ(true);
        } else if (this.ʼ.getVisibility() != 0 || ˏˎ()) {
            this.ॱॱ.setVisibility(0);
        }
        this.ॱᐝ.setImageResource(a.ʻॱ);
        this.ॱॱ.setImageResource(a.ʻॱ);
        this.ʽ.setImageResource(a.ʻॱ);
    }

    private void ˊᐝ() {
        Context context = getContext();
        if (context != null) {
            if (this.ˎ.ʻॱ() || this.ˎ.ॱˎ()) {
                this.ˎ.ॱˊ();
                evt.ॱ(this.ˎ.ॱ(), (int) this.ˎ.ˊᐝ());
            }
            if (this.ˎ.ʼॱ()) {
                ˏ(context);
            }
        }
    }

    private void ˏ(Context context) {
        if (context != null && !cku.ˏ(context, "showFailedDialog")) {
            try {
                cku ˏ = cku.ˏ(context, cku.class, null, context.getString(j.ˏॱ));
                ˏ.ˎ(-2, 8);
                ˏ.setCancelable(false);
                ˏ.ॱ(new cks(this) {
                    final /* synthetic */ evo ˊ;

                    {
                        this.ˊ = r1;
                    }

                    public void enableNetworking() {
                        evt.ॱ(this.ˊ.ˎ.ॱ(), (int) this.ˊ.ˎ.ˊᐝ());
                        this.ˊ.ˎ.ˊ();
                    }

                    public void upgrade() {
                    }

                    public void ˋ() {
                    }
                });
                ˏ.ˋ(context, "showFailedDialog");
            } catch (Throwable e) {
                Logger.ˋ("VideoPlayerController", "showFailedDialog error", e);
            }
        }
    }

    public void ˋ(int i) {
        String str;
        ॱ(false);
        ˎˏ();
        String str2 = "0";
        Activity activity = (Activity) getContext();
        switch (i) {
            case 10:
                ॱˊ();
                this.ˏॱ.setImageResource(a.ॱˋ);
                this.ͺ.setImageResource(a.ॱˋ);
                this.ˏॱ.setContentDescription(getContext().getResources().getString(j.ˋˋ));
                this.ͺ.setContentDescription(getContext().getResources().getString(j.ˋˋ));
                this.ʻॱ.setVisibility(4);
                this.ॱˎ.setVisibility(0);
                this.ʽ.setVisibility(0);
                ॱˋ();
                str = str2;
                break;
            case 11:
                this.ॱˎ.setVisibility(4);
                this.ʻॱ.setVisibility(0);
                this.ॱॱ.setVisibility(8);
                ˏ(8);
                ˏॱ();
                this.ˏॱ.setImageResource(a.ॱˎ);
                this.ͺ.setImageResource(a.ॱˎ);
                this.ˏॱ.setContentDescription(getContext().getResources().getString(j.ˋˊ));
                this.ͺ.setContentDescription(getContext().getResources().getString(j.ˋˊ));
                ॱˋ();
                ॱ(activity);
                str = "1";
                break;
            default:
                str = str2;
                break;
        }
        ॱ("video_fullscreen_click", HwAccountConstants.TRUSTCIRCLE_VERIFY_REQUEST_KEY_SCREENPWD_FLAG, str);
    }

    private void ॱ(Activity activity) {
        switch (activity.getWindowManager().getDefaultDisplay().getRotation()) {
            case 1:
                activity.setRequestedOrientation(0);
                return;
            case 3:
                activity.setRequestedOrientation(8);
                return;
            default:
                activity.setRequestedOrientation(1);
                return;
        }
    }

    public void ˋ() {
        ˊ();
    }

    public void ˊ() {
        this.ʽॱ = false;
        this.ʿ = false;
        ॱˊ();
        ͺॱ();
        if (this.ˋॱ != null) {
            this.ˋॱ.setProgress(0);
            this.ˋॱ.setSecondaryProgress(0);
        }
        if (this.ˎ == null || TextUtils.isEmpty(this.ˎ.ॱ())) {
            this.ॱॱ.setVisibility(8);
        } else {
            this.ॱॱ.setVisibility(0);
        }
        ˊˋ();
        if (this.ʼ != null) {
            this.ʼ.setVisibility(8);
        }
        if (this.ˏॱ != null) {
            this.ˏॱ.setImageResource(a.ॱˋ);
            this.ˏॱ.setContentDescription(getContext().getResources().getString(j.ˋˋ));
        }
        if (this.ͺ != null) {
            this.ͺ.setImageResource(a.ॱˋ);
            this.ͺ.setContentDescription(getContext().getResources().getString(j.ˋˋ));
        }
        if (this.ᐝॱ != null) {
            this.ᐝॱ.setVisibility(8);
        }
    }

    public void ॱ(long j) {
        if (!ʼ()) {
            evt.ॱ(this.ˎ.ˋˋ(), j, this.ˉ);
        }
        if (j > 0) {
            evp ˋˋ = this.ˎ.ˋˋ();
            etd.ˏ(ˋˋ, this.ˍ, String.valueOf(this.ˎ.ˊᐝ()), this.ˊˋ);
            evt.ˎ(ˋˋ, String.valueOf(this.ˋᐝ), String.valueOf(System.currentTimeMillis()), String.valueOf(this.ˎ.ˊᐝ() - this.ˌ), String.valueOf(this.ˎ.ˊˊ()));
        }
    }

    public void ˋ(int i, int i2, String str, String str2) {
        if (!ʼ()) {
            eta.ˊ(i, i2, str, str2);
        }
        if (this.ˎ.ʾ()) {
            this.ˊᐝ = "1";
            this.ˊˋ = "1";
            return;
        }
        this.ˊᐝ = String.valueOf(i);
        this.ˊˋ = String.valueOf(i);
    }

    public int ˎ(String str) {
        return evt.ˊ(str);
    }

    public void ˊ(String str, int i) {
        evt.ॱ(str, i);
    }

    public void onClick(View view) {
        if (view == this.ॱॱ) {
            ˉ();
        } else if (view == this.ʽ || view == this.ॱᐝ) {
            if (this.ˎ.ʻॱ() || this.ˎ.ॱˎ()) {
                this.ˎ.ॱˊ();
            } else if (this.ˎ.ᐝॱ()) {
                ˎ(true);
            }
        } else if (view == this.ˏॱ || view == this.ͺ) {
            ˎˎ();
        } else if (view == this.ˊॱ || view == this.ॱˋ) {
            ˍ();
        } else if (view == this && !ॱ(true)) {
            ˌ();
        }
    }

    private void ˉ() {
        if (this.ˎ.ॱᐝ()) {
            ˎ(false);
        }
        if (this.ˎ.ᐝॱ()) {
            ˎ(true);
        }
    }

    private void ˋᐝ() {
        this.ʿ = false;
        this.ˎ.ᐝ();
        LinkedHashMap linkedHashMap = new LinkedHashMap();
        linkedHashMap.put("default", "default");
        linkedHashMap.put("videoId", this.ˎ.ˋˋ().ॱ());
        linkedHashMap.put("videoUrl", this.ˎ.ˋˋ().ˊ());
        linkedHashMap.put("appId", this.ˎ.ˋˋ().ˎ());
        linkedHashMap.put("trace", this.ˎ.ˋˋ().ˏ());
        linkedHashMap.put("logId", this.ˎ.ˋˋ().ʼ());
        linkedHashMap.put("logSource", this.ˎ.ˋˋ().ʽ());
        linkedHashMap.put("spId", this.ˎ.ˋˋ().ॱॱ());
        if (getContext() instanceof Activity) {
            linkedHashMap.put("service_type", String.valueOf(ʻ()));
        }
        ॱ("video_manualpaly", linkedHashMap);
    }

    private void ˋˋ() {
        this.ʿ = false;
        this.ˎ.ʻ();
    }

    private void ˌ() {
        boolean z = true;
        if (this.ˎ.ᐝॱ() && this.ॱॱ.getVisibility() != 0) {
            if (this.ˎ.ʼॱ()) {
                ˏ(true);
            } else {
                ˏ(false);
                this.ॱॱ.setVisibility(0);
            }
            this.ॱॱ.setImageResource(a.ʻॱ);
        }
        if (this.ˎ.ʻॱ() || this.ˎ.ॱˎ()) {
            if (this.ʽॱ) {
                z = false;
            }
            ˏ(z);
        }
    }

    private void ˎˎ() {
        if (this.ˎ.ʽॱ()) {
            this.ˎ.ˊˋ();
        } else if (this.ˎ.ʼॱ()) {
            this.ˎ.ˊ();
        }
    }

    private void ˊ(boolean z) {
        if (z) {
            if (this.ˎ.ͺ()) {
                ॱᐝ();
            }
        } else if (this.ˎ.ˏॱ()) {
            ʻॱ();
        }
    }

    private void ˍ() {
        String str = "1";
        if (ॱˎ()) {
            ˊ(false);
            evt.ˊ(this.ˎ.ॱ(), 2);
            str = "0";
        } else {
            evt.ˊ(this.ˎ.ॱ(), 1);
            ˊ(true);
        }
        ॱ("video_mute_click", HwAccountConstants.TRUSTCIRCLE_VERIFY_REQUEST_KEY_SCREENPWD_FLAG, str);
    }

    private void ˎ(final boolean z) {
        Context context = getContext();
        if (doo.ˊ(context)) {
            epe.ˏ().ˊ(7);
            if (!VideoNetChangeDialog.ˏ(context) || this.ˋˋ) {
                ˋ(z);
                return;
            } else if (!VideoNetChangeDialog.ˊ()) {
                ˋ(z);
                return;
            } else if (this.ˎˎ) {
                ᐝॱ();
                return;
            } else {
                VideoNetChangeDialog o_evs = new VideoNetChangeDialog(context);
                o_evs.ˋ(new d(this) {
                    final /* synthetic */ evo ˏ;

                    public void ˊ() {
                        this.ˏ.ˋ(z);
                    }

                    public void ॱ() {
                        if (this.ˏ.ˎ.ʼॱ()) {
                            this.ˏ.ˎ.ˊ();
                        }
                    }
                });
                o_evs.ˋ();
                return;
            }
        }
        ˏˏ();
    }

    private void ˋ(boolean z) {
        if (z) {
            ˋˋ();
        } else {
            ˋᐝ();
        }
    }

    private boolean ˏˎ() {
        if (this.ʼ.getVisibility() == 0 && this.ॱˎ.getVisibility() == 0 && this.ʽ.getVisibility() != 0) {
            return true;
        }
        return false;
    }

    private void ˏˏ() {
        Toast.makeText(getContext(), j.ॱʼ, 0).show();
    }

    private void ˏ(boolean z) {
        this.ʼ.setVisibility(z ? 0 : 8);
        this.ʽॱ = z;
        if (!z) {
            ͺॱ();
        } else if (!this.ˎ.ᐝॱ()) {
            ˎˏ();
        }
    }

    private void ˑ() {
        if (!this.ʿ && !this.ʽॱ && !ˏˎ()) {
            ͺ();
            this.ʼ.setVisibility(0);
            this.ʽ.setVisibility(8);
            this.ʽॱ = true;
            if (this.ˈ == null) {
                this.ˈ = new CountDownTimer(this, 3000, 3000) {
                    final /* synthetic */ evo ˎ;

                    public void onTick(long j) {
                    }

                    public void onFinish() {
                        this.ˎ.ʽॱ = false;
                        this.ˎ.ʿ = true;
                        this.ˎ.ˈ = null;
                        this.ˎ.ʽ.setVisibility(0);
                        if (this.ˎ.ˎ.ʼॱ() && this.ˎ.ˎ.ᐝॱ()) {
                            this.ˎ.ˏ(true);
                        } else {
                            this.ˎ.ʼ.setVisibility(8);
                        }
                    }
                };
            } else {
                this.ˈ.cancel();
            }
            this.ˈ.start();
        }
    }

    private boolean ॱ(boolean z) {
        if (this.ˈ == null) {
            return false;
        }
        this.ˈ.cancel();
        this.ˈ = null;
        this.ʽ.setVisibility(0);
        this.ʿ = true;
        if (!z) {
            return true;
        }
        this.ʼ.setVisibility(8);
        this.ʽॱ = false;
        return true;
    }

    private void ˎˏ() {
        if (this.ʼ.getVisibility() == 0 && !ˏˎ()) {
            ͺॱ();
            if (this.ʼॱ == null) {
                this.ʼॱ = new CountDownTimer(this, 3000, 3000) {
                    final /* synthetic */ evo ˋ;

                    public void onTick(long j) {
                    }

                    public void onFinish() {
                        if (!this.ˋ.ˎ.ᐝॱ()) {
                            this.ˋ.ˏ(false);
                        } else if (this.ˋ.ˎ.ʼॱ()) {
                            this.ˋ.ˏ(true);
                        } else {
                            this.ˋ.ˏ(false);
                            this.ˋ.ॱॱ.setVisibility(0);
                            this.ˋ.ॱॱ.setImageResource(a.ʻॱ);
                        }
                    }
                };
            }
            this.ʼॱ.start();
        }
    }

    private void ͺॱ() {
        if (this.ʼॱ != null) {
            this.ʼॱ.cancel();
        }
    }

    public void onProgressChanged(SeekBar seekBar, int i, boolean z) {
        if (z) {
            if (this.ʾ <= 0) {
                this.ʾ = this.ˎ.ˊˊ();
            }
            this.ʻ.setText(anr.ˊ(this.ˋ, this.ˊ, (long) (((float) (this.ʾ * ((long) seekBar.getProgress()))) / 1000.0f)));
        }
    }

    public void onStartTrackingTouch(SeekBar seekBar) {
        ॱ("video_progressbar_click", "default", "default");
        ͺॱ();
    }

    public void onStopTrackingTouch(SeekBar seekBar) {
        if (this.ˎ.ᐝॱ()) {
            ˋˋ();
        }
        this.ˎ.ॱ((long) (((float) (this.ˎ.ˊˊ() * ((long) seekBar.getProgress()))) / 1000.0f));
        ˎˏ();
    }

    public void ᐝ() {
        if (!this.ˎ.ʽॱ()) {
            long ˊᐝ = this.ˎ.ˊᐝ();
            long ˊˊ = this.ˎ.ˊˊ();
            this.ˋॱ.setSecondaryProgress(this.ˎ.ˉ() * 10);
            this.ˋॱ.setProgress((int) ((1000.0f * ((float) ˊᐝ)) / ((float) ˊˊ)));
            this.ʻ.setText(anr.ˊ(this.ˋ, this.ˊ, ˊᐝ));
            this.ॱˊ.setText(anr.ˊ(this.ˋ, this.ˊ, ˊˊ));
        }
    }

    public boolean ʼ() {
        if (this.ˎ != null) {
            evp ˋˋ = this.ˎ.ˋˋ();
            if (ˋˋ != null && ˋˋ.ᐝ()) {
                return true;
            }
        }
        return false;
    }

    private void ॱ(String str, String str2, String str3) {
        if (!ʼ()) {
            dgh.ॱ(str, str2, str3);
        }
    }

    private void ॱ(String str, LinkedHashMap<String, String> linkedHashMap) {
        if (!ʼ()) {
            dgh.ˋ(str, linkedHashMap);
        }
    }
}
